package com.lingxin.gps.wap.controller;

import com.jfinal.aop.Before;
import com.lingxin.gps.wap.ApiLoginInterceptor;
import com.lingxin.gps.wap.PageLoginInterceptor;
import com.lingxin.gps.wap.command.*;
import com.pisces.core.BaseController;
import com.pisces.core.route.ControllerBind;

/**
 * 设备管理
 *
 * @author hdl
 */
@ControllerBind(controllerKey = "/device", viewPath = "/device")
public class DeviceController extends BaseController {

	/**
	 * 用户设备列表
	 */
	@Before(PageLoginInterceptor.class)
	public void list() {
		doAction(new CDeviceList());
		renderPage("list.html");
	}

	@Before(ApiLoginInterceptor.class)
	public void ajaxList() {
		doAction(new CDeviceList());
		renderJson();
	}

	/**
	 * 设备详情
	 */
	@Before(ApiLoginInterceptor.class)
	public void detail() {
		doAction(new CDeviceDetail());
		renderJson();
	}

	/**
	 * 设备焊接记录查询
	 */
	@Before(PageLoginInterceptor.class)
	public void weldQuery() {
		doAction(new CDeviceWeldQuery());
		renderPage("weld_query.html");
	}

	/**
	 * 设备焊接记录
	 */
	@Before(PageLoginInterceptor.class)
	public void weldList() {
		doAction(new CDeviceWeldList());
		renderPage("weld_list.html");
	}

	/**
	 * 设备焊接记录
	 */
	@Before(ApiLoginInterceptor.class)
	public void ajaxWeldList() {
		doAction(new CDeviceWeldList());
		renderJson();
	}

	/**
	 * 设备定位
	 */
	@Before(ApiLoginInterceptor.class)
	public void position() {
		doAction(new CDevicePosition());
		renderJson();
	}

	/**
	 * 设备轨迹查询
	 */
	@Before(PageLoginInterceptor.class)
	public void trackQuery() {
		doAction(new CDeviceTrackQuery());
		renderPage("track_query.html");
	}

	/**
	 * 设备轨迹图
	 */
	@Before(PageLoginInterceptor.class)
	public void track() {
		doAction(new CDeviceTrack());
		renderPage("track_map.html");
	}

	/**
	 * 设备轨迹图
	 */
	@Before(ApiLoginInterceptor.class)
	public void ajaxTrack() {
		doAction(new CDeviceTrack());
		renderJson();
	}


}
